#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time


def index():
    print("welcome to index..")
    time.sleep(1)
    return 123


def home(tip):
    print("this price {}".format(tip))


def timer(func):
    def wrapper(*args, **kwargs):
        start = time.time()
        res = func(*args, **kwargs)
        end = time.time()
        print("程序运行时间: {}".format(end - start))
        return res
    return wrapper

a1=timer(index)
print(a1())

a2=timer(home)
print(a2("test"))
